package com.liull.netty.cust_protocol;

import io.netty.util.CharsetUtil;

/**
 * @Author: liull
 * @Description: 自定义协议
 * @Date: Created in 16:41 2020/11/15
 * @Modified By:
 */
public class PersonProtocol {
    private int length;

    private byte[] content;

    public PersonProtocol(int length, byte[] content) {
        this.length = length;
        this.content = content;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "PersonProtocol{" +
                "length=" + length +
                ", content=" + new String(content, CharsetUtil.UTF_8) +
                '}';
    }
}
